package com.jingtai.platform.controller.merchants;

import com.jingtai.core.entity.merchants.MerchantsSupplyUndertakesApply;
import com.jingtai.platform.service.merchants.MerchantsSupplyUndertakesApplyService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 商户向供应商申请一件代发
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/merchantssupplyundertakesapply")
@Api(tags = "商户向供应商申请一件代发")
public class MerchantsSupplyUndertakesApplyController{

    @Autowired
    private MerchantsSupplyUndertakesApplyService merchantsSupplyUndertakesApplyService;


    @ApiOperation("商户向供应商申请一件代发列表查询")
    @GetMapping("/list")
    public ResultUtil aopMerchantsSupplyUndertakesApplyList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return merchantsSupplyUndertakesApplyService.MerchantsSupplyUndertakesApplylist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询merchantsSupplyUndertakesApply实体")
    @GetMapping("/getMerchantsSupplyUndertakesApplyById")
    public ResultUtil GetMerchantsSupplyUndertakesApplyById(@CApiParam(name = "id",value = "merchantsSupplyUndertakesApply实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsSupplyUndertakesApplyService.getMerchantsSupplyUndertakesApplyById(id);
    }


    @ApiOperation("新增merchantsSupplyUndertakesApply实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"merchantsSupplyUndertakesApply.id","merchantsSupplyUndertakesApply.createTime","merchantsSupplyUndertakesApply.updateTime","merchantsSupplyUndertakesApply.deleteFlag"})
    public ResultUtil aopAddMerchantsSupplyUndertakesApply(@RequestBody @Validated MerchantsSupplyUndertakesApply merchantsSupplyUndertakesApply){
        return merchantsSupplyUndertakesApplyService.addMerchantsSupplyUndertakesApply(merchantsSupplyUndertakesApply);
    }

    @ApiOperation("编辑merchantsSupplyUndertakesApply实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"merchantsSupplyUndertakesApply.createTime","merchantsSupplyUndertakesApply.updateTime","merchantsSupplyUndertakesApply.deleteFlag"})
    public ResultUtil aopEditMerchantsSupplyUndertakesApply(@RequestBody @Validated MerchantsSupplyUndertakesApply merchantsSupplyUndertakesApply){
        return merchantsSupplyUndertakesApplyService.editMerchantsSupplyUndertakesApply(merchantsSupplyUndertakesApply);
    }

    @ApiOperation("根据ID删除merchantsSupplyUndertakesApply实体")
    @GetMapping("/delMerchantsSupplyUndertakesApplyById")
    public ResultUtil aopDelMerchantsSupplyUndertakesApplyById(@CApiParam(name = "id",value = "merchantsSupplyUndertakesApply实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsSupplyUndertakesApplyService.delMerchantsSupplyUndertakesApplyById(id);
    }

}






